package com.bangdao.app.jetpacktest.jetpack.lifecycle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.LifecycleService;

import android.os.Bundle;

import com.bangdao.app.jetpacktest.R;

public class LifecycleActivity2 extends AppCompatActivity {

    private MediaPlayerListener2 mediaPlayerListener2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lifecycle2);

        mediaPlayerListener2 = new MediaPlayerListener2();

        //将观察者与被观察者绑定
        getLifecycle().addObserver(mediaPlayerListener2);
    }
}